package com.ruoyi.myweb.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.myweb.mapper.ResOrderMapper;
import com.ruoyi.myweb.domain.ResOrder;
import com.ruoyi.myweb.service.IResOrderService;

/**
 * 订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-16
 */
@Service
public class ResOrderServiceImpl implements IResOrderService 
{
    @Autowired
    private ResOrderMapper resOrderMapper;

    /**
     * 查询订单
     * 
     * @param id 订单主键
     * @return 订单
     */
    @Override
    public ResOrder selectResOrderById(Long id)
    {
        return resOrderMapper.selectResOrderById(id);
    }

    /**
     * 查询订单列表
     * 
     * @param resOrder 订单
     * @return 订单
     */
    @Override
    public List<ResOrder> selectResOrderList(ResOrder resOrder)
    {
        return resOrderMapper.selectResOrderList(resOrder);
    }

    /**
     * 新增订单
     * 
     * @param resOrder 订单
     * @return 结果
     */
    @Override
    public int insertResOrder(ResOrder resOrder)
    {
        resOrder.setCreateTime(DateUtils.getNowDate());
        return resOrderMapper.insertResOrder(resOrder);
    }

    /**
     * 修改订单
     * 
     * @param resOrder 订单
     * @return 结果
     */
    @Override
    public int updateResOrder(ResOrder resOrder)
    {
        resOrder.setUpdateTime(DateUtils.getNowDate());
        return resOrderMapper.updateResOrder(resOrder);
    }

    /**
     * 批量删除订单
     * 
     * @param ids 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteResOrderByIds(Long[] ids)
    {
        return resOrderMapper.deleteResOrderByIds(ids);
    }

    /**
     * 删除订单信息
     * 
     * @param id 订单主键
     * @return 结果
     */
    @Override
    public int deleteResOrderById(Long id)
    {
        return resOrderMapper.deleteResOrderById(id);
    }
}
